<html>
<head>
 
</head>
<body style="text-align=center;font-size:24px">
<div id="problemNum" style='background-color:#999999;width:400;text-align:left;'></div>
<div id="problemContent" style='background-color:#bbbbbb;width:400;text-align:left;'></div>
<div id="result" style='color:#ffff22;font-size:48;background-color:#8855ff;width:400;'></div>
 
<script language="javascript">
    //---------------------------------//
    // Project Euler 
    //
    // Author:thrombin
    //   Date:2015-12-07
    //---------------------------------//  
var N=5;//Problem Order
var problem="2520 is the smallest number that can be divided by each of the numbers from 1 to 10 without any remainder.What is the smallest positive number that is evenly divisible by all of the numbers from 1 to 20?";
//solve the problem
var i;
var result=1;
var nums=new Array(19);
for(i=0;i<19;i++){
    nums[i]=i+2;
}
for(var i=0;i<19;i++){
    result*=nums[i];
    for(var j=i+1;j<19;j++){
        if(nums[j]%nums[i]==0)nums[j]/=nums[i];
    }
}
//update browser
document.getElementById("problemNum").innerHTML="Project Euler-Problem "+N;
document.getElementById("problemContent").innerHTML=problem;
document.getElementById("result").innerHTML="Answer:"+result;
 
</script>
</body>
</html>